import { reactive } from "vue";
import axios from "axios";

export default function()
{
    let dogList = reactive([
        "https://gw.alicdn.com/tfscom/tuitui/TB2ONIjnTJYBeNjy1zeXXahzVXa_!!0-rate.jpg",
      ]);
       
      async function getDog() {
        try {
          let result = await axios.get(
            "https://api.uomg.com/api/rand.img3?sort=胖次猫&format=json"
          );
          console.log(result.data);
          dogList.push(result.data.imgurl);
        } catch (error) {
          alert(error);
        }
      }
      // 向外部提供数据

      return {dogList, getDog}

}